from typing import Any

import scrapy


class Scrapy58TcSpider(scrapy.Spider):
    # 爬虫名称，执行命令 scrapy crawl 58_tc
    name = "58_tc"
    allowed_domains = ["https://hf.58.com/sou/"]
    start_urls = ["https://hf.58.com/sou/?key=%E5%89%8D%E7%AB%AF%E5%BC%80%E5%8F%91"]

    def parse(self, response, **kwargs: Any):
        text = response.text
        # print('text======>>>> ', text)
        selector_list = response.xpath("//div[@id='filter']/div[@class='tabs']/a/span")
        print('类型======>>>> ', selector_list.extract_first)
